package shangjie

class Boy(var name:String, var shuai:Int) extends Comparable[Boy]{
  override def compareTo(o: Boy): Int = {
    this.shuai - o.shuai
  }
}
class Pair[T <: Comparable[T]]{
  def comp(t1:T, t2:T): Int ={
    t1.compareTo(t2)
  }
}
object ShangJieDemo {
  def main(args: Array[String]): Unit = {
    val luhan = new Boy("luhan", 100)
    val wuyanzu = new Boy("wuyanzu", 90)
    val pair = new Pair[Boy]()
    val who = pair.comp(luhan, wuyanzu)
    println(who)
  }
}
